#ifndef TEXTEDITOR_H
#define TEXTEDITOR_H

#include <QMainWindow>
#include <QString>

#include"finddlg.h"

namespace Ui {
    class TextEditor;
}

class TextEditor : public QMainWindow
{
    Q_OBJECT

public:
    explicit TextEditor(QWidget *parent = 0);
    ~TextEditor();

private:
    Ui::TextEditor *ui;

    QString curFile;
    FindDlg *findDlg;
    bool isSaved;
    bool save();
    bool saveAs();
    bool okToContinue();
    bool saveFile(const QString& fileName);
    bool loadFile(const QString &fileName);

private slots:
    void on_actionInsert_DateTime_triggered();
    void on_actionSelect_All_triggered();
    void on_actionFind_triggered();
    void on_action_Paste_triggered();
    void on_action_Copy_triggered();
    void on_action_Cut_triggered();
    void on_action_Undo_triggered();
    void on_actionAboutQt_triggered();
    void on_actionAbout_triggered();
    void on_action_Quit_triggered();
    void on_action_SaveAs_triggered();
    void on_action_Save_triggered();
    void on_action_Open_triggered();
    void on_action_New_triggered();
    void findText(const QString& text);
};

#endif // TEXTEDITOR_H
